/**
 * 缓冲区裁剪
 * buf.slice([start[, end]])
 */

var buffer1 = new Buffer('runoob');
// 剪切缓冲区
var buffer2 = buffer1.slice(0,2);
console.log("buffer2 content: " + buffer2.toString()); //buffer2 content: ru

/**
 * 缓冲区长度
 */
var buffer = new Buffer('www.runoob.com');
//  缓冲区长度
console.log("buffer length: " + buffer.length); // buffer length: 14